package com.ssm.service.imp;

import com.ssm.dao.UserDao;
import com.ssm.domain.User;
import com.ssm.service.UserService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author wangLin
 * @version 1.0
 * @projectName maven-ssm-wl
 * @className UserServiceImp
 * @date 2021-03-16 周二
 * @time 18:21
 * @description TODO
 */

@Service
public class UserServiceImp implements UserService {

    @Resource
    private UserDao userDao;

    /**
     * 登录
     *
     * @param user
     * @return result
     */
    @Override
    public boolean login(User user) {
        boolean result = false;
        List<User> userList = userDao.findUser(user);
        if (userList.size() > 0) {
            result = true;
        }
        return result;
    }

    /**
     * 注册
     *
     * @param user
     * @return
     */
    @Override
    public void insertUser(User user) {
        userDao.insertUser(user);
    }

}
